#ifndef SEMAPHORE_H_INCLUDED
#define SEMAPHORE_H_INCLUDED

#include <pthread.h>

#define SEMAPHORE pthread_rwlock_t
#define CONCURENT


void SEM_CREATE(SEMAPHORE& sem);
void SEM_READLOCK(SEMAPHORE& sem);
void SEM_WRITELOCK(SEMAPHORE& sem);
void SEM_UNLOCK(SEMAPHORE& sem);
int SEM_TRYWRITELOCK(SEMAPHORE& sem);
void SEM_DESTROY(SEMAPHORE& sem);

#endif // SEMAPHORE_H_INCLUDED
